package com.vercon.common.mode.weather;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

/**
 * Created by csh on 2021/5/26
 */
public class AirAuality implements Serializable {
    /**
     * resultcode : 200
     * reason : SUCCESSED!
     * result : [{"city":"苏州","PM2.5":"73","AQI":"98","quality":"良","PM10":"50","CO":"0.79","NO2":"65","O3":"28","SO2":"41","time":"2014-12-26 11:48:40"}]
     * error_code : 0
     */

    private String resultcode;
    private String reason;
    private int error_code;
    private List<ResultBean> result;

    public boolean isSuccessful() {
        return resultcode.equals("200");
    }

    public String getResultcode() {
        return resultcode;
    }

    public void setResultcode(String resultcode) {
        this.resultcode = resultcode;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public List<ResultBean> getResult() {
        return result;
    }

    public void setResult(List<ResultBean> result) {
        this.result = result;
    }

    public static class ResultBean implements Serializable {
        /**
         * city : 苏州
         * PM2.5 : 73
         * AQI : 98
         * quality : 良
         * PM10 : 50
         * CO : 0.79
         * NO2 : 65
         * O3 : 28
         * SO2 : 41
         * time : 2014-12-26 11:48:40
         */

        private String city;
        @SerializedName("PM2.5")
        private String pm25; // FIXME check this code
        @SerializedName("AQI")
        private String aqi;
        private String quality;
        private String PM10;
        @SerializedName("CO")
        private String co;
        private String NO2;
        private String O3;
        private String SO2;
        private String time;

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public String getPm25() {
            return pm25;
        }

        public void setPm25(String pm25) {
            this.pm25 = pm25;
        }

        public String getAqi() {
            return aqi;
        }

        public void setAqi(String aqi) {
            this.aqi = aqi;
        }

        public String getQuality() {
            return quality;
        }

        public void setQuality(String quality) {
            this.quality = quality;
        }

        public String getPM10() {
            return PM10;
        }

        public void setPM10(String PM10) {
            this.PM10 = PM10;
        }

        public String getCo() {
            return co;
        }

        public void setCo(String co) {
            this.co = co;
        }

        public String getNO2() {
            return NO2;
        }

        public void setNO2(String NO2) {
            this.NO2 = NO2;
        }

        public String getO3() {
            return O3;
        }

        public void setO3(String o3) {
            O3 = o3;
        }

        public String getSO2() {
            return SO2;
        }

        public void setSO2(String SO2) {
            this.SO2 = SO2;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        @Override
        public String toString() {
            return "ResultBean{" +
                    "city='" + city + '\'' +
                    ", pm25='" + pm25 + '\'' +
                    ", aqi='" + aqi + '\'' +
                    ", quality='" + quality + '\'' +
                    ", PM10='" + PM10 + '\'' +
                    ", co='" + co + '\'' +
                    ", NO2='" + NO2 + '\'' +
                    ", O3='" + O3 + '\'' +
                    ", SO2='" + SO2 + '\'' +
                    ", time='" + time + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "AirAuality{" +
                "resultcode='" + resultcode + '\'' +
                ", reason='" + reason + '\'' +
                ", error_code=" + error_code +
                ", result=" + result +
                '}';
    }
}